import { ArticleDetail } from '@/services/creationCenter/typing';
import { convertTimeZone } from '@/utils/operateTime';
import { Card } from 'antd';
import styles from '../index.module.scss';

type DraftItemProps = {
  detail: ArticleDetail;
};

const DraftItem: React.FC<DraftItemProps> = ({ detail }) => {
  return (
    <>
      <Card>
        <Card.Meta title={detail.title} />
        <div className={styles.content}>
          &nbsp;&nbsp;&nbsp;&nbsp;
          {detail.content.length < 50
            ? detail.content
            : detail.content.substring(0, 60) + '...'}
        </div>
        <div className={styles.footer}>
          {convertTimeZone(detail.update_time)}
        </div>
      </Card>
    </>
  );
};

export default DraftItem;
